package kr.hkit.powerjava.chapter06.assign_for;

public class Two {

	private int num, reversenum;
	
	public Two(int num) {
		super();
		this.num = num;
	}

	int reverse(){
		reversenum=0;
		do{
		reversenum += num%10;
		num/=10;
		if(num > 0)
			reversenum *= 10;
		} while(num > 0);
		
		return reversenum;
	}

	@Override
	public String toString() {
		return "Two [기존의 수는 " + num + ", 뒤집힌 수는" + reverse() + "]";
	}
	
	
}
